package demo;

class Student{
    static int num;
    static {
        System.out.println("静态代码执行num"+ ++num);
    }
    {
        System.out.println("构造代码执行num"+ ++num);
    }

    public Student() {
        System.out.println("无参构造方法执行num"+ ++num);
    }
    public Student(int number) {
        this();
        System.out.println("有参构造方法在执行num"+ ++num);
    }
}
public class Dome3 {
    public static void main(String[] args) {
        new Student(56);
        new Student();
    }
}
